import request from '@/utils/request'

// 创建危险作业票
export function createDangerTicket(data) {
  return request({
    url: '/biz/danger-ticket/create',
    method: 'post',
    data: data
  })
}

// 更新危险作业票
export function updateDangerTicket(data) {
  return request({
    url: '/biz/danger-ticket/update',
    method: 'put',
    data: data
  })
}

// 删除危险作业票
export function deleteDangerTicket(id) {
  return request({
    url: '/biz/danger-ticket/delete?id=' + id,
    method: 'delete'
  })
}

// 获得危险作业票
export function getDangerTicket(id) {
  return request({
    url: '/biz/danger-ticket/get?id=' + id,
    method: 'get'
  })
}

// 获得危险作业票分页
export function getDangerTicketPage(query) {
  return request({
    url: '/biz/danger-ticket/page',
    method: 'get',
    params: query
  })
}

// 导出危险作业票 Excel
export function exportDangerTicketExcel(query) {
  return request({
    url: '/biz/danger-ticket/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
